package test3_tx.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import test3_tx.domain.Account;

//转账dao
public interface AccountDao {

    @Update("update tbl_account set money=money+ #{money} where name = #{name}")
    void inMoney(@Param("name") String name,@Param("money") Double money);

    @Update("update tbl_account set money=money- #{money} where name = #{name}")
    void outMoney(@Param("name") String name,@Param("money") Double money);

    //需要有返回值，否则会报错
    @Select("select * from tbl_account where name= #{name}")
    Account getMoneyByName(@Param("name") String name);
}
